import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
// import tag from '../14.MyTag.vue'
// import First from '../tabs/First.vue'
// import Second from '../tabs/Second.vue'
// import Third from '../tabs/Third.vue'
// import NotFound from '../tabs/404.vue'
import Login  from  '../mianjing/Login.vue'
import Register  from  '../mianjing/Register.vue'
import Layout  from  '../mianjing/Layout.vue'
import Home  from  '../mianjing/Sub/Home.vue'
import Collect  from  '../mianjing/Sub/Collect.vue'
import Love  from  '../mianjing/Sub/Love.vue'
import My  from  '../mianjing/Sub/My.vue'
import Detail  from  '../mianjing/Detail.vue'

Vue.use(VueRouter)

/* 路由规则 */
const routes = [
  {
    path:'/login',
    name:'login',
    component:Login
  },
  {
    path:'/register',
    name:'Register',
    component:Register
  },
  {
    path:'/detail/:id',
    name:'detail',
    component:Detail
  },
  {
    path:'/',
    name:'layout',
    component:Layout,
    redirect:'/home',
    children:[
      {
        path:'/home',
        name:'home',
        component:Home,
        meta:{
          keepAlive:true
        }
      },
      {
        path:'/collect',
        name:'collect',
        component:Collect
      },
      {
        path:'/love',
        name:'love',
        component:Love
      },
      {
        path:'/my',
        name:'my',
        component:My,
        meta:{
          keepAlive:true
        }
      }
      // {
      //   path:'home',
      //   name:'首页',
      //   component:Home
      // },
      // {
      //   path:'collect',
      //   name:'收藏',
      //   component:Collect
      // },
      // {
      //   path:'love',
      //   name:'喜欢',
      //   component:Love
      // },
      // {
      //   path:'my',
      //   name:'我的',
      //   component:My
      // }
    ]
  }
]

const router = new VueRouter({
  // linkActiveClass: 'aa',
  // linkExactActiveClass: 'bb',
  mode:'hash',//配置路由模式
  routes:routes
})

export default router
